package com.xiaocg.juc.lock;

import java.util.concurrent.locks.ReentrantLock;

public class SynTest {
    public static void main(String[] args) {
        ReentrantLock lock = new ReentrantLock(true);
    }
}

class Person {
    /**
     * 类锁
     */
    public static synchronized void test1(){
        System.out.println("-----test1");
    }

    /**
     * 对象锁
     */
    public synchronized void  test2(){
        System.out.println("-------test2");
    }
}
